<?php
/* -------------------------------------
*
*  Engine
*
*  @copyright: Anton Minakov
*
*  @author: Anton Minakov
*  @email: maggotjb@gmail.com
*
*  this file should be load first
*
* --------------------------------------
*/

//die("<h1>Обновляемся</h1>");

define("MAIN_DIR",dirname(__FILE__).DIRECTORY_SEPARATOR);
require_once MAIN_DIR.DIRECTORY_SEPARATOR."core".DIRECTORY_SEPARATOR."defines.php";
require_once CORE."settings.php";
require_once CORE."functions.php";
require_once CORE."classes.php";

session_start();

$route = new Router();
$db = new MySQL(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
$user = new User();

switch ($route->getPath(1)) {
	
	case "": require_once APP."we.php"; break;
	case "invite": require_once APP."invite.php"; break;
	case "wedding": require_once APP."wedding.php"; break;
	
	case "admin": require_once ADMIN.MAINFILE; break;

	default: to();
}

?>